#!/bin/sh

ps -o etime -p $(ps -o ppid -p $$ --no-headers) --no-headers | awk '
BEGIN {
	format[1]="s"
	format[2]="m"
	format[3]="h"
	format[4]="d"
	printf "message-info '"'"' Uptime: "
}
{
	sub("-"," ",$NR)
	gsub(":"," ",$NR)
	i=split($NR,a," ")
	for (k=i;k>0;k--) {
		printf "%s%s ",a[(i-k)+1],format[k]
	}
}
END {
	print "'"'"'"
}' > $QUTE_FIFO
